﻿@model SpaceNeedle.City6473.WebSite.Models.AppsModel
@using SpaceNeedle.City6473.Web.Data.Models

@{
    var staticContent = ViewBag.StaticContent as WebSiteContent;
    ViewBag.Title = staticContent.Apps.PageTitle;
}

<div>
    @using (Html.BeginForm())
{

        <div class="control-group">
            @Html.Label(staticContent.Apps.Name, new { @class = "control-label" })

            <div class="controls">
                @Html.TextBoxFor(model => model.Name, new { @class = "input-xlarge" })
                @Html.ValidationMessageFor(model => model.Name)
            </div>
        </div>

        <div class="control-group">
            @Html.Label(staticContent.Apps.Icon, new { @class = "control-label" })

            <div class="controls">
                @Html.TextBoxFor(model => model.Icon, null, new { @class = "input-xlarge" })
                @Html.ValidationMessageFor(model => model.Icon)
            </div>
        </div>

        <div class="control-group">
            @Html.Label(staticContent.Apps.Uri, new { @class = "control-label" })

            <div class="controls">
                @Html.TextBoxFor(model => model.Uri, new { @class = "input-xlarge" })
                @Html.ValidationMessageFor(model => model.Uri)


            </div>
        </div>

        <div class="control-group">
            @Html.Label(staticContent.Apps.IsEnabled, new { @class = "control-label" })

            <div class="controls">
                <input id="isEnabled" type="checkbox" name="isEnabled" value=""/>
            </div>
        </div>

        <div class="control-group">
            @Html.Label(staticContent.Apps.PermissionLevel, new { @class = "control-label" })

            <div class="controls">
                @Html.DropDownList("PermissionLevel", null, new { @class = "input-xlarge" })
            </div>
        </div>

        <div class="control-group">
            @Html.Label(staticContent.Apps.Description, new { @class = "control-label" })

            <div class="controls">
                @Html.TextAreaFor(model => model.Description, new { @class = "input-xlarge" })
                @Html.ValidationMessageFor(model => model.Description)
            </div>
        </div>

        <div class="control-group">
            <div class="controls">
                <button id="singlebutton" name="singlebutton" class="btn btn-primary">@staticContent.Operations.Add</button>
            </div>
        </div>
    }
</div>

<script>
    $(document).ready(function () {
        $('#isEnabled').click(function () {

            if ($(this).is(':checked')) {
                $(this).attr('value', 'true');
            }
            else {
                $(this).attr('value', 'false');
            }
        });
    });
</script>
